package edu.scu.declaresys.dao.impl;

import edu.scu.declaresys.dao.intr.IAreaDAO;
import edu.scu.declaresys.exception.ExecuteException;
import edu.scu.declaresys.vo.Area;

public class AreaDAOImpl extends GeneralDAOImpl<Area> implements IAreaDAO
{

	public AreaDAOImpl()
	{
		super(Area.class);
	}

	@Override
	protected void fillReference(Area vo, int depth) throws ExecuteException
	{
		if(!vo.getId().equals(vo.getParentId()))
		{
			vo.setParent(this.findById(vo.getParentId(), depth - 1));
		}
		vo.setChildren(this.findByProperty(Area.T_PARENT_ID, vo.getId(), depth - 1, null, null, Area.T_ID, true));
		return ;
	}
}
